update_site_option_{$option}
Action HookDescription
Fires after the value of a specific network option has been successfully updated. The dynamic portion of the hook name, `$option`, refers to the option name.Hook Information
File Location |
wp-includes/option.php
View on GitHub
|
Hook Type | Action |
Line Number | 2463 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$option
|
Name of the network option. |
mixed
|
$value
|
Current value of the network option. |
mixed
|
$old_value
|
Old value of the network option. |
int
|
$network_id
|
ID of the network. |
Usage Examples
Basic Usage
<?php
// Hook into update_site_option_{$option}
add_action('update_site_option_{$option}', 'my_custom_function', 10, 4);
function my_custom_function($option, $value, $old_value, $network_id) {
// Your custom code here
}
Source Code Context
wp-includes/option.php:2463
- How this hook is used in WordPress core
<?php
2458 * @param string $option Name of the network option.
2459 * @param mixed $value Current value of the network option.
2460 * @param mixed $old_value Old value of the network option.
2461 * @param int $network_id ID of the network.
2462 */
2463 do_action( "update_site_option_{$option}", $option, $value, $old_value, $network_id );
2464
2465 /**
2466 * Fires after the value of a network option has been successfully updated.
2467 *
2468 * @since 3.0.0
PHP Documentation
<?php
/**
* Fires after the value of a specific network option has been successfully updated.
*
* The dynamic portion of the hook name, `$option`, refers to the option name.
*
* @since 2.9.0 As "update_site_option_{$key}"
* @since 3.0.0
* @since 4.7.0 The `$network_id` parameter was added.
*
* @param string $option Name of the network option.
* @param mixed $value Current value of the network option.
* @param mixed $old_value Old value of the network option.
* @param int $network_id ID of the network.
*/
Quick Info
- Hook Type: Action
- Parameters: 4
- File: wp-includes/option.php
Related Hooks
Related hooks will be displayed here in future updates.